---
title: Prisma
---

import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; // For package-install code blocks

If you’re using [Prisma](https://www.prisma.io/), in most cases you can automatically generate a useful ER diagram with Liam ERD. This page provides instructions and tips for generating an ER diagram in a Prisma project.

## Prisma and `schema.prisma`

When a Prisma project manages migrations using the Prisma CLI, the latest schema is typically described in `schema.prisma`.  

When using Liam CLI, specify `--format prisma` and `--input path/to/schema.prisma` as follows:

```npm
npx @liam-hq/cli erd build --format prisma --input prisma/schema.prisma
```

If the above command runs without issue, you should see an ER diagram generated.

### Handling Multiple Prisma Schema Files

If you use the [prismaSchemaFolder](https://www.prisma.io/docs/orm/prisma-schema/overview/location#multi-file-prisma-schema) option in your Prisma configuration, you can still generate the ER diagram by specifying a glob pattern to include all `.prisma` files in the folder. 

For example, if you have multiple `.prisma` files in the `prisma/schema/` directory, use the following command:

```npm
npx @liam-hq/cli erd build --format prisma --input "prisma/schema/*.prisma"
```

This allows you to generate the ER diagram.

## Under the Hood

Liam CLI analyzes the content of your `schema.prisma` file using a dedicated parser that relies on [`@prisma/internals`](https://www.npmjs.com/package/@prisma/internals) to build the ER diagram.
